<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>管理中心</title>
    <meta name="robots" content="noindex, nofollow">
    <link rel="shortcut icon" href="${ctx}/favicon.ico"/>
    <link rel="icon" href="${ctx}/animated_favicon.gif" type="image/gif"/>
    <link href="${ctx}/static/css/ui.css" rel="stylesheet" type="text/css"/>
    <link href="${ctx}/static/css/large.css" rel="stylesheet" type="text/css"/>
    <link href="${ctx}/static/css/main.css" rel="stylesheet" type="text/css"/>
    <link href="${ctx}/static/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link href="${ctx}/static/css/icons.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="${ctx}/static/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/layer/layer.js"></script>
    <script type="text/javascript" src="${ctx}/static/fonts/iconfont.js"></script>
</head>
<body>
<%--<script type="text/javascript" src="${ctx}/static/js/adminIndex.js"></script>--%>
<div class="admin-header clearfix" style="position:fixed;background: #2A3F5D;">
    <!-- 颜色选择层 bylu -->
    <div class="bgSelector"></div>
    <div class="admin-logo">
        <img src="${ctx}/static/images/admin-logo.png"/>
    </div>
    <div class="admin-header-right">
        <div class="manager">
            <dl>
                <dt class="name">admin</dt>
                <dd class="group">超级管理员</dd>
            </dl>
			<span class="avatar">
				<form id="fileForm" method="post" enctype="multipart/form-data" runat="server">
                    <input name="img" type="file" class="admin-avatar-file" id="_pic" title="设置管理员头像">
                </form>
				<img nctype="admin_avatar" src="${ctx}/static/images/admin.png"/>
			</span>
            <i class="arrow" id="admin-manager-btn"></i>
            <div class="manager-menu">
                <div class="title">
                    <h4>最后登录</h4>
                    <a href="privilege.php?act=edit&id=41" target="workspace" class="edit_pwd">修改密码</a>
                </div>
                <div class="login-date">
                    <strong>2017-02-18 16:29:22</strong>
                    <span>(IP:127.0.0.1)</span>
                </div>
                <div class="title mt10">
                    <h4>常用操作</h4>
                    <a href="javascript:;" class="add_nav">添加菜单</a>
                </div>
                <div class="quick_link">
                    <ul>
                    </ul>
                </div>
            </div>
        </div>
        <div class="operate">
            <li style="position: relative;">
                <a href="javascript:void(0);" class="msg" title="查看消息">&nbsp;</a>
                <!-- 消息通知 bylu -->
                <div id="msg_Container" style="display: none;">
                    <%--<div class="item">--%>
                        <%--<h3>订单提示</h3>--%>
                        <%--<div class="msg_content" ectype="orderMsg"><p><a href="javascript:void(0);" data-url="order.php?act=list&amp;composite_status=101" data-param="menushopping|02_order_list" target="workspace" class="message">待发货订单</a> <span class="tiptool">（<em id="no_paid">24</em>）</span></p><p><a href="javascript:void(0);" data-url="order.php?act=return_list" data-param="menushopping|12_back_apply" target="workspace" class="message">待处理退换货订单</a> <span class="tiptool">（<em id="no_change">0</em>）</span></p><p><a href="javascript:void(0);" data-url="order.php?act=list" data-param="menushopping|02_order_list" target="workspace" class="message">您有新订单</a> <span class="tiptool">（<em id="new_orders">0</em>）</span></p><p><a href="javascript:void(0);" data-url="order.php?act=list" data-param="menushopping|02_order_list" target="workspace" class="message">您有新付款的订单</a> <span class="tiptool">（<em id="new_paid">0</em>）</span></p></div>--%>
                    <%--</div>--%>
                    <%--<div class="item">--%>
                        <%--<h3>商家审核提示</h3>--%>
                        <%--<div class="msg_content" ectype="sellerMsg"><p><a href="javascript:void(0);" data-url="merchants_users_list.php?act=list&amp;check=1" data-param="menushopping|02_merchants_users_list" target="workspace" class="message">未审核商家</a> <span class="tiptool">（<em id="shop_account">4</em>）</span></p><p><a href="javascript:void(0);" data-url="merchants_account.php?act=list&amp;act_type=account_log&amp;handler=2&amp;rawals=1" data-param="menushopping|12_seller_account" target="workspace" class="message">待审核商家提现</a> <span class="tiptool">（<em id="wait_cash">0</em>）</span></p></div>--%>
                    <%--</div>--%>
                    <%--<div class="item">--%>
                        <%--<h3>广告位提示</h3>--%>
                        <%--<div class="msg_content" ectype="advMsg"><p><a href="javascript:void(0);" data-url="ads.php?act=list" data-param="menuplatform|ad_list" target="workspace" class="message">广告位即将到期</a> <span class="tiptool">（<em id="advance_date">0</em>）</span></p></div>--%>
                    <%--</div>--%>
                    <%--<div class="item hide" ectype="cServiceDiv">--%>
                        <%--<h3>售后服务</h3>--%>
                        <%--<div class="msg_content" ectype="cService"></div>--%>
                    <%--</div>--%>
                </div>
            </li>
            <i></i>
            <li><a href="javascript:send();" id="trace_show" class="style-color" title="给管理中心换个颜色">&nbsp;</a></li>
            <i></i>
            <li><a href="index.php?act=clear_cache" class="clear" target="workspace" title="清除缓存">&nbsp;</a></li>
            <i></i>
            <li><a href="privilege.php?act=logout" class="prompt" title="安全退出管理中心">&nbsp;</a></li>
        </div>
    </div>
</div>
<style>
    .gn-panel {
        line-height: 40px;
        font-size: 15px;
        color: black;
        border-bottom: 1px solid #E4EAEC;
        margin-bottom: 10px;
        background: #F5F5F5;
    }

    .gn-panel i {
        padding: 0 10px 0 20px
    }

    .treeMenu ul {
        margin: 0;
        padding: 0;
        color: black;
        font-size: 14px;
    }

    .treeMenu ul > li {
    }

    .treeMenu ul > li > .title > i {
        padding-left: 20px;
        padding-right: 10px;
    }

    .treeMenu ul > li > .title > span {
        position: absolute;
        right: 5px;
        top: 8px;
    }

    .treeMenu ul > li > .title {
        line-height: 35px;
        margin: 5px 8px;
        position: relative;
        border-left: 2px solid transparent;
    }

    .treeMenu ul > li.current > .title {
        border-bottom: #E4EAEC 1px solid;
    }

    .treeMenu ul > li > .title:hover {
        cursor: pointer;
        border-bottom-right-radius: 5px;
        border-top-right-radius: 5px;
    }

    .treeMenu ul > li > .sub-menu {
        line-height: 30px;
        border: 1px solid transparent;
    }

    .treeMenu ul > li > .sub-menu > div {
        padding-left: 20px;
        border-left: 2px solid transparent;
        margin: 5px 8px 5px 40px;
        border-bottom-right-radius: 5px;
        border-top-right-radius: 5px;
        cursor: pointer;
    }

    .treeMenu ul > li > .sub-menu > div > i {
        padding-right: 10px;
    }

    .treeMenu ul > li > .sub-menu > div.active {
        color: #D01405;
    }

    .treeMenu ul > li > .sub-menu > div:hover {
        color: #D01405;
    }

    .loading-box {
        position: fixed;
        top: 42%;
        left: 55%;
        width: 40px;
        height: 40px;
        z-index: 500;

    }

    .loading {
        position: absolute;
        top: 0;
        left: 0;
        width: 40px;
        height: 40px;
        border-top: 0.2em solid rgba(242, 242, 242, 0.8);
        border-right: 0.2em solid rgba(242, 242, 242, 0.8);
        border-bottom: 0.2em solid rgba(242, 242, 242, 0.8);
        border-left: 0.2em solid rgba(255, 0, 0, 1);
        -webkit-animation: loading 1.1s infinite linear;
        animation: loading 1.1s infinite linear;
        border-radius: 50%;
    }

    .loading-box .loading-logo {
        position: absolute;
        top: 8px;
        left: 5px;
        width: 35px;
        height: 28px;
    }

    @-webkit-keyframes loading {
        0% {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
        }
        100% {
            -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
        }
    }

    @keyframes loading {
        0% {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
        }
        100% {
            -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
        }
    }
</style>
<div class="treeMenu" style="position:fixed;top:50px; background: #FFFFFF;width:200px;">
    <div class="gn-panel"><i class="ac-font" nameCls="#icon-windows"></i> 功能面板</div>
    <ul class="sub-menu">
        <li>
            <div class="title"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>文章管理 <span
                    class="fa fa-angle-right"></span></div>
            <div class="sub-menu" style="display: none">
                <div target="${ctx}/admin/article/add.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>添加文章</div>
                <div target="${ctx}/admin/article/list.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>文章列表</div>
                <div target="${ctx}/admin/article/category.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>文章分类</div>
                <div target="${ctx}/admin/article/collect.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>数据采集</div>
                <div target="${ctx}/admin/article/rule.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>规则管理</div>
                <div target="${ctx}/admin/article/rule.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>模板管理</div>
            </div>
        </li>
        <li>
            <div class="title"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>商城管理 <span
                    class="fa fa-angle-right"></span></div>
            <div class="sub-menu" style="display: none">
                <div target="${ctx}/admin/b2b2c/add.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>添加商品</div>
                <div target="${ctx}/admin/b2b2c/list.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>商品列表</div>
                <div target="${ctx}/admin/b2b2c/category.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>商品分类</div>
                <div target="${ctx}/admin/b2b2c/order.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>订单管理</div>
                <div target="${ctx}/admin/b2b2c/seller.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>门店管理</div>
                <div target="${ctx}/admin/b2b2c/member.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>会员管理</div>
                <div target="${ctx}/admin/b2b2c/payset.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>支付配置</div>
                <div target="${ctx}/admin/article/rule.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>模板管理</div>
            </div>
        </li>
        <li>
            <div class="title"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>视频管理 <span
                    class="fa fa-angle-right"></span></div>
            <div class="sub-menu" style="display: none">
                <div target="${ctx}/admin/video/add.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>添加视频</div>
                <div target="${ctx}/admin/video/list.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>视频列表</div>
                <div target="${ctx}/admin/video/category.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>视频分类</div>
            </div>
        </li>
        <li>
            <div class="title"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>图片管理 <span
                    class="fa fa-angle-right"></span></div>
            <div class="sub-menu" style="display: none">
                <div target="${ctx}/admin/photo/add.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>添加图片</div>
                <div target="${ctx}/admin/photo/list.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>图片列表</div>
                <div target="${ctx}/admin/photo/category.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>图片分类</div>
            </div>
        </li>
        <li>
            <div class="title"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>权限管理 <span
                    class="fa fa-angle-right"></span></div>
            <div class="sub-menu" style="display: none">
                <div target="${ctx}/admin/auth/user.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>用户管理</div>
                <div target="${ctx}/admin/auth/role.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>角色管理</div>
                <div target="${ctx}/admin/auth/res.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>资源管理</div>
                <div target="${ctx}/admin/auth/org.jsp"><i class="ac-font" nameCls="#icon-jibiequanxian"></i>组织管理</div>
            </div>
        </li>
        <li>
            <div class="title" target="${ctx}/admin/session.jsp"><i class="ac-font" nameCls="#icon-shezhi"></i>会话管理</div>
        </li>
        <li>
            <div class="title" target="${ctx}/druid/" type="1"><i class="ac-font" nameCls="#icon-user-copy"></i>SQL监控
            </div>
        </li>
        <li>
            <div class="title"><i class="ac-font" nameCls="#icon-shezhi"></i>任务管理</div>
        </li>
        <li>
            <div class="title" target="${ctx}/admin/dict.jsp"><i class="ac-font" nameCls="#icon-shujuku"></i>字典管理</div>
        </li>
        <li>
            <div class="title"><i class="ac-font" nameCls="#icon-rizhi"></i>日志管理 <span class="fa fa-angle-right"></span>
            </div>
            <div class="sub-menu" style="display: none">
                <div target="${ctx}/admin/log/login.jsp"><i class="ac-font" nameCls="#icon-rizhi"></i>登录日志</div>
                <div target="${ctx}/admin/log/service.jsp"><i class="ac-font" nameCls="#icon-rizhi"></i>业务日志</div>
                <div target="${ctx}/admin/log/excption.jsp"><i class="ac-font" nameCls="#icon-rizhi"></i>错误日志</div>
            </div>
        </li>
    </ul>
</div>
<div class="warpper">
    <div class="title"></div>
    <div class="content"></div>
</div>
<script type="text/javascript" src="${ctx}/static/js/ui.js"></script>
<script type="text/javascript" src="${ctx}/static/js/app.js"></script>
<%--<script type="text/javascript" src="${ctx}/static/js/jquery.json.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/transport_jquery.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/utils.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/listtable.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/listtable_pb.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/perfect-scrollbar.min.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/dsc_admin2.0.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/jquery-ui.min.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/jquery.cookie.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/calendar.min.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/jquery.bgColorSelector.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/jquery.validation.min.js"></script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/common.js"></script>--%>
<script type="text/javascript" src="${ctx}/static/js/jquery.form.js"></script>
<%--<script type="text/javascript" src="${ctx}/static/js/jquery.nyroModal.js"></script>--%>
<%--<!--[if lt IE 9]>--%>
<%--<script src="${ctx}/static/js/css3-mediaqueries.js"></script>--%>
<%--<![endif]-->--%>
<%--<script language="JavaScript">--%>
<%--/*这里把JS用到的所有语言都赋值到这里*/--%>
<%--var process_request = "<i class='icon-spinner icon-spin'></i>";--%>
<%--var todolist_caption = "记事本";--%>
<%--var todolist_autosave = "自动保存";--%>
<%--var todolist_save = "保存";--%>
<%--var todolist_clear = "清除";--%>
<%--var todolist_confirm_save = "是否将更改保存到记事本？";--%>
<%--var todolist_confirm_clear = "是否清空内容？";--%>
<%--var expand_all = "展开";--%>
<%--var collapse_all = "闭合";--%>
<%--var shop_name_not_null = "商店名称不能为空";--%>
<%--var good_name_not_null = "商品名称不能为空";--%>
<%--var good_category_not_null = "商品分类不能为空";--%>
<%--var good_number_not_number = "商品数量不是数值";--%>
<%--var good_price_not_number = "商品价格不是数值";--%>
<%--window["ctx"] = "${ctx}";--%>
<%--</script>--%>
<%--<script type="text/javascript" src="${ctx}/static/js/jquery.purebox.js"></script>--%>
<script type="text/javascript">
    window["ctx"] = "${ctx}";
    var app = app.init({ctx: "${ctx}"});

    var websocket = null;
    //判断当前浏览器是否支持WebSocket
    if('WebSocket' in window){
        websocket = new WebSocket("ws://192.168.20.120:81/cms/websocket/mrliu");
        console.log("websocket link success!")
    }else if ('MozWebSocket' in window)
        websocket = new MozWebSocket("ws://192.168.20.120:81/cms/websocket/mrliu");
    else
        alert('当前浏览器 Not support websocket !');


    //连接发生错误的回调方法
    websocket.onerror = function(e){
        alert(JSON.stringify(e));
    };

    //连接成功建立的回调方法
    websocket.onopen = function(event){
        alert("onopen");
    }

    //接收到消息的回调方法
    websocket.onmessage = function(e){
        tips.success(e.data);
        $('embed').remove();
//        $('body').('<audio autoplay="autoplay"><source src="http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=3&text='+ e.data+'" type="audio/mp3"/></audio>');
        $('body').append('<embed src="http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=5&text='+ e.data+'" autostart="true" hidden="true" loop="false">');
    }

//    //连接关闭的回调方法
//    websocket.onclose = function(){
//        alert("onclose");
//    }

    //监听窗口关闭事件，当窗口关闭时，主动去关闭websocket连接，防止连接还没断开就关闭窗口，server端会抛异常。
    window.onbeforeunload = function(){
        websocket.close();
    }


    //发送消息
    function send(){
        var message = "连接成功, send消息!";
        websocket.send(message);
    }

</script>
</body>
</html>
